<template>
  <div class="home">
    <div class="head">
      <div class="left">
        <img src="../assets/img.jpg"
             alt="">
        <h1>课堂在线后台管理系统</h1>
      </div>
      <div class="right">
        <div class="hy">
          <el-dropdown @command="handleCommand">
            <span class="el-dropdown-link">
              下拉菜单<i class="el-icon-arrow-down el-icon--right"></i>
            </span>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item command="info">个人信息</el-dropdown-item>
              <el-dropdown-item command="exit">退出</el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
        </div>
      </div>
    </div>
    <div class="content">
      <div class="left">
        <MyMenu></MyMenu>
      </div>
      <div class="right">
        <router-view/>
      </div>
    </div>
   
  </div>
</template>
<script>
import MyMenu from '../components/MyMenu.vue'
export default {
  components:{MyMenu},
  name: 'home',
  data() {
    return {
      
    }
  },
  methods: {
    // 下拉菜单事件
    handleCommand(val) {
      if (val == 'info') {
        this.$message('个人信息')
      } else {
        localStorage.removeItem('token')
        this.$message.info('成功退出')
        this.$router.push({ name: 'login' })
      }
    },
  },
}
</script>
<style lang="scss" scoped>
.head {
  width: 100%;
  height: 60px;
  background: #324057;
  display: flex;
  justify-content: space-between;
  .left {
    display: flex;
    line-height: 60px;
    img {
      width: 60px;
      height: 60px;
      border-radius: 50%;
    }
    h1 {
      font-size: 24px;
      color: #fff;
      margin-left: 20px;
    }
  }
  .right {
    padding: 20px;
    display: flex;
    .hy {
      margin-top: 0 auto;
      text-align: center;
      .el-dropdown-link {
        color: #fff;
      }
      p {
        color: #fff;
      }
    }
  }
}
.content {
  display: flex;
  .left {
    width: 250px;
    height: 650px;
    border-top: 1px solid #2a384c;
    
  }
  .right {
    padding: 20px;
    width: 100%;
  }
  
}
.el-dialog {
  text-align: center;
  .el-form {
    text-align: center;
    margin-left: 20px;
  }
  .ipt {
    width: 80%;
  }
}
</style>